package com.cnap.db.entity;

import com.cnap.model.intelligent.IntelligentTask;

import java.time.LocalDateTime;

/**
 * 智能调度策略数据库模型
 *
 * @author xc
 **/
public class IntelligentTaskPO {
    private String serviceId;
    private boolean active;
    private String cron;
    private LocalDateTime createTime;

    /**
     * get
     *
     * @return ServiceId
     */
    public String getServiceId() {
        return serviceId;
    }

    /**
     * set
     *
     * @param serviceId serviceId
     */
    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    /**
     * get
     *
     * @return Active
     */
    public boolean isActive() {
        return active;
    }

    /**
     * set
     *
     * @param active active
     */
    public void setActive(boolean active) {
        this.active = active;
    }

    /**
     * get
     *
     * @return Cron
     */
    public String getCron() {
        return cron;
    }

    /**
     * set
     *
     * @param cron cron
     */
    public void setCron(String cron) {
        this.cron = cron;
    }

    /**
     * get
     *
     * @return CreateTime
     */
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    /**
     * set
     *
     * @param createTime createTime
     */
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    /**
     * 转换成task
     *
     * @return 结果
     */
    public IntelligentTask toTask() {
        IntelligentTask task = new IntelligentTask();
        task.setSvcId(this.serviceId);
        task.setCron(this.cron);
        return task;
    }
}
